<template>
  <div class="box">
    <div class="card">
      <div class="image-container">
        <img :src="image.src" :alt="image.title" />
        <div class="text-overlay">
          <h2>{{ image.title }}</h2>
          <p>{{ image.description }}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    image: {
      type: Object,
      required: true,
    },
  },
};  
</script>

<style scoped>
.box {
  float: left;
  justify-content: space-between;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
  width: 1200px;
  height: 680px;

}

.card {
  position: relative;
  width: 100%;

}

.image-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.text-overlay {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;

  color: #fff;
  padding: 20px;
  font-size: 24px;
  z-index: 1;
}

.text-overlay h2 {
  align-self: flex-start;
  margin: 0;
}
</style>